@extends("admin.layout.main")

@section("content")

    <style>
        .form-group label {
            text-align: left !important;
            width: 110px;
        }

        .form-horizontal > div {
            margin-left: 22px !important;
        }

        .col-sm-9 input {
            width: 180px;
        }

        .error {
            width: fit-content !important;
            margin-left: 5px;
            color: red;
        }
    </style>
    <div class="page-header">
        <h1>
            管理员
        </h1>
    </div>
    <form class="form-horizontal" id="form" method="post" action="{{ route('admin.platform.ajaxModule') }}">
        <input type="hidden" name="id" value="{{ $info->id }}">
        <div class="form-group">
            <label class="col-sm-1 control-label sm-1"> 上级模块：</label>
            <div class="col-sm-9">
                <select name="parent_id" style="width:180px;" onchange="getAuthoriry(this)">
                    <option value="0">一级模块</option>
                    @foreach($data as $v)
                        <option value="{{ $v->id }}">{{ $v->name }}</option>
                        @foreach($v->children as $cv)
                            <option value="{{ $cv->id }}">└{{ $cv->name }}</option>
                        @endforeach
                    @endforeach
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label sm-1"> 模块名称：</label>

            <div class="col-sm-9">
                <input type="text" required value="{{ $info->name }}" name="name" placeholder="请输入模块名称"
                       class="col-xs-10 col-sm-5">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label sm-1"> 模块url：</label>

            <div class="col-sm-9">
                <input type="text" required value="{{ $info->action_code }}" name="action_code" placeholder="请输入模块url"
                       class="col-xs-10 col-sm-5">
            </div>
        </div>
        <div class="clearfix form-actions">
            <div class="col-md-offset-2 col-md-9">
                <button class="btn btn-info" type="submit" id="submit">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    保存
                </button>
                <a class="btn" onclick="window.history.back()">
                    <i class="ace-icon fa fa-undo bigger-110"></i>
                    取消
                </a>
            </div>
        </div>
    </form>
    <script src="{{ config('global.assets_path') }}js/jquery.validate.min.js"></script>
    <script src="{{ config('global.assets_path') }}js/messages_zh.js"></script>
    <script src="/plugins/layui/layui.js"></script>
    <script src="/plugins/layui/layui_component.js"></script>
    <script src="/js/ajax.js"></script>

@endsection